The present invention relates to an apparatus and a method for producing print data of a two-dimensional code. The two-dimensional code comprises numerous cells representing binary coded data and arranged as a bright-and-dark pattern on a two-dimensional matrix. Furthermore, the present invention relates to recording media storing program data required for executing the processing for producing the print data in a computer.
Compared with conventional bar codes, many of the two-dimensional codes have the capability of storing a great amount of information. This is advantageous in reducing the overall size of the code. The reading operation of the two-dimensional codes is generally performed based on a dark-and-bright judgement on each cell. Prior to the dark-and-bright judgement, the central position of each cell on a two-dimensional code image is estimated based on computations. Then, the dark-and-bright judgement is performed by judging brightness or darkness of each cell at (or in the vicinity of) the estimative central position. However, the two-dimensional code may not be positioned in parallel with the reading line of a scanner. The two-dimensional code may be printed on a curved or curled surface. In such cases, the scanner possibly reads the two-dimensional image along an inclined direction, with an incorrect estimative central position of each cell deviated from the true position.
If the deviated estimative central position remains in the same cell, it is still possible to correctly judge the brightness and darkness of the cell. Namely, the dark cell will be judged as a dark portion and the bright cell will be judged as a bright portion as far as the estimative central position remains in the same cell.
In many cases, facsimile machines and copying machines are involved in the reading operation of the two-dimensional codes. For example, a receiver""s facsimile or copying machine prints out a copy of the two-dimensional code which comprises dark cells having grown fat. In the case of the facsimile machine, the resolution limit of its line sensor causes such a growing-fat phenomenon of the dark cells since each sensor element decides the minimum resolution level in the judgment of the darkness and brightness. FIG. 9A shows a scanning operation by a line scanner performed along a periphery of a dark cell. When seen in individual sensor elements, the dark cell occupies part (e.g., a half or a quarter) of the unit area in some of sensor elements. More specifically, when focused on six sensor elements arraying in the line scanning direction shown in FIG. 9A, a first sensor element is a complete bright portion. A second sensor element is a composite element whose three-quarter is a bright portion with the remaining quarter of a dark portion. Next two, i.e., third and fourth, sensor elements are also composite elements each consisting of a bright portion and a dark portion by fifty-fifty. Then, a fifth sensor element is a composite element whose three-quarter is a bright portion with the remaining quarter of a dark portion. And, the last, i.e., a sixth, sensor element is a complete bright portion.
FIG. 9B shows an output signal of the line sensor which is proportional to the area of the bright portion (i.e., proportional to brightness) in each sensor element. A threshold, for detecting the dark portion, is set at a predetermined level which is relatively high. When the sensor signal of a sensor element is lower than the threshold, this sensor element is judged as a dark portion. If the threshold is set at a lower level, certain information may be neglected. For example, a sensor element will be judged as a bright portion when it comprises a smaller dark portion and a larger bright portion. In other words, there is the data not reproducible due to neglect or elimination of the smaller dark portions. Thin lines may disappear. To avoid such disappearing of important information, the threshold is set to a relatively higher level. Accordingly, there is a high probability that a composite sensor element, comprising both dark and bright portions, is judged as a dark portion. As a result, each cell tends to grow fat. For example, a regular-size dark cell of 3 dotsxc3x973 dots shown in FIG. 9C expands to the size of 4 dotsxc3x974 dots shown in FIG. 9D. For comparison, FIG. 9E shows a shrunken dark cell of 2 dotsxc3x972 dots.
FIG. 10 shows an example of two-dimensional code including a growing-fat dark cell. Each dark cell has peripheral sides overhanging over neighboring bright cells. The above-described estimative central position of the dark cell may deviate largely into the overhung region. In such a case, a bright cell will be erroneously detected by as a dark cell. This drawback will be explained in more detail with reference to FIG. 10. A cell xe2x80x9cAxe2x80x9d and a cell xe2x80x9cDxe2x80x9d shown in FIG. 10 are originally bright cells and are discriminable as bright cells even at their deviated estimative center positions. A cell xe2x80x9cBxe2x80x9d is originally a dark cell and is discriminable as a dark cell even at its deviated estimative central position. However, a cell xe2x80x9cCxe2x80x9d is judged as a dark cell although it is originally a bright cell because a neighboring (i.e. right) dark cell overhangs over the deviated estimative central position of the cell xe2x80x9cCxe2x80x9d. Thus, the bright cell xe2x80x9cCxe2x80x9d is erroneously judged as a dark cell. Thus, the data, represented by the brightness and darkness of the cells, is undesirably changed into another data having different contents or meaning.
The above-described explanation is for the growing-fat phenomenon of the dark cells, but is equally applied to the growing-fat phenomenon of the bright cells. In this case, the bright cells overhang over the dark cells. The dark cell is erroneously judged as a bright cell when its estimative central position is located in the overhanging region of the bright cell.
In view of the foregoing, the present invention has an object to provide an apparatus and a method for producing print data of a two-dimensional code which is capable of preventing erroneous judgement in the reading of the data, even when a facsimile or copying machine prints out a two-dimensional code including growing-fat dark cells. Furthermore, the present invention provides recording media which store program data required for executing the processing for producing the print data.
To accomplish the above and other related objects, the present invention provides an apparatus for producing print data of a two-dimensional code. The two-dimensional code comprises cells representing binary coded data and arranged as a pattern on a two-dimensional matrix. The pattern comprises dark and bright cells. The printing operation is performed by printing only dark cells while leaving a non-printed region which is discriminable as the bright cells. A print data producing means is provided for producing print data for modifying the size of the dark cells in advance so that a boundary between the dark cells and the bright cells is adjustable before performing the printing operation.
According to the present invention, it is preferable that the print data producing means is for producing the print data for expanding the cell size of each dark cell when the boundary between the dark cells and the bright cells is shifted toward the region of the bright cells, and is for producing the print data for expanding the cell size of each bright cell when the boundary between the dark cells and the bright cells is shifted toward the region of the dark cells.
In general, the print data are developed as a matrix pattern of 0 and 1 representing bright and dark portions on a bit map. Accordingly, when the regular-size cell has a cell size of 5 dotsxc3x975 dots, expansion of the dark cell is performed by increasing the cell size to 6 dotsxc3x976 dots and developing the expanded dark cell on the bit map. When the dark cell is expanded to the size of 6 dotsxc3x976 dots, the expanded dark cell (1) overhangs over a neighboring bright cell (0) or dark cell (1). In this case, dark (1) is selected in the overlapped region unless both of the overlapped cells are bight (0).
On the other hand, shrinkage of the dark cell is performed by increasing the cell size of the bright cell to 6 dotsxc3x976 dots and developing the expanded bright cell on the bit map. When the bright cell is expanded to the size of 6 dotsxc3x976 dots, the expanded bright cell (0) overhangs over a neighboring dark cell (1) or bright cell (0). In this case, bright (0) is selected in the overlapped region unless both of the overlapped cells are dark (1). As a result, the cell size of the dark cell is reduced to 4 dotsxc3x974 dots. No shrinkage occurs in the overlap region of dark cells.
According to the present invention, it is preferable to perform the shrinkage of the dark cells by expanding the cell size of bright cells, not by shrinking the cell size of dark cells, although the same result is obtained. This is explained in more detail with reference to FIGS. 11A to 11C. In shrinking the dark cells, it is necessary to cause no shrinkage in the boundary region where two dark cells are positioned next to each other. In other words, the shrinkage of dark cells is only allowed in the region where black and while cells are positioned next to each other. If the shrinkage is performed in each black cell, undesirable bright portions will appear between neighboring black cells as shown in FIG. 11A. If the deviated estimative cell centers are positioned in the undesirable bright portions as shown in FIG. 11B, the dark cells will be erroneously recognized as bright cells. In FIG. 11B, the cell xe2x80x9caxe2x80x9d is correctly judged as a bright cell even at the deviated estimative central position. However, other cells xe2x80x9cbxe2x80x9d, xe2x80x9ccxe2x80x9d and xe2x80x9cdxe2x80x9d are erroneously judged as bright cells as their deviated estimative central positions are located in the bright portions. If xe2x80x9cnxe2x80x9d dark cells are aligned adjacent to each other and deviated in the same manner, all of them will be erroneously judged. To solve this problem, it is essential to form no bright portions between adjacent dark cells as shown in FIG. 11C. In this case, the cell xe2x80x9cdxe2x80x9d may be erroneously judged as a bright cell. However, other cells xe2x80x9cbxe2x80x9d and xe2x80x9ccxe2x80x9d are correctly judged as dark cells. In short, the judgement is correctly performed for all of xe2x80x9cnxe2x80x9d cells except one. The remaining one cell may be erroneously judged. This is not applied to dark cells not aligned adjacent to each other.
To the contrary, the shrinkage of the dark cells is simply performed by increasing the cell size of the bright cells. All thing necessary to do is selecting white (0) when the expanded bright cell (0) overhangs over the dark cell (1). The data processing is simple.
Enlargement of the cell size of the dark or bright cell is performed by adding a line or row of dots along one or more sides of the cell. In this case, it is preferable that the enlargement is performed along two adjacent sides or all of the four sides of the cell. For example, the enlargement of the cell size can be accomplished by adding a line of dots along a lateral side of the cell and further adding a row of dots along an adjacent longitudinal side. In this case, the two sides of the cell need to be designiated beforehand. Similarly, the enlargement of the cell side can be accomplished by adding a line or row of dots along all of the four sides of the cell. When the cell is increased by 3 dots in each of the longitudinal and lateral directions, it is preferable to add two lines of dots along one lateral side of the cell and two rows of dots along an adjacent longitudinal side, and further add a line of dots along an opposed lateral side and a row of dots along an opposed longitudinal side. In this manner, the enlargement of the cell size can be easily realized by increasing the longitudinal and lateral sides of the cell by an amount of xe2x80x9cnxe2x80x9d dots (n is an integer equal to or larger than 1).
According to the present invention, the print data of the two-dimensional code can be produced for intentionally adjusting the cell size of the dark cells beforehand. Thus, even when the dark cells grow fat or get thin through the reading operation of the two-dimensional code by the facsimile or copying machine, it becomes possible to equalize the printed cell to the regular-size cell or suppress the difference between them.
Furthermore, it is preferable to perform the enlargement of the cell size based on operator""s instructions. To this end, an input means is provided for allowing the operator to enter a side or sides of a dark or bright cell to be expanded or shrunk as well as the degree of expansion or shrinkage. The print data producing means produces the print data for modifying the dark or bright cells based on the information relating to the side or sides to be modified and the size modification degree which are both entered through the input means. The growing-fat or getting-thin degree of each dark cell depends on individual facsimile or copying machines or may vary in accordance with reading conditions. Accordingly, it is preferable that the operator can optimize the settings of the prior cell size adjustment based on actually observed cells on the two-dimensional code.
The above-described print data producing apparatus is effectively used in a mail-order selling system. A purchase order includes a two-dimensional code printed based on the print data produced by the print data producing apparatus of the present invention. The printed purchase order is then transmitted from a buyer to a seller through facsimile communications (i.e., data reading and transmission). The present mail-order selling systems using the telephone and facsimile communications are still major, although the electronic transaction using the Internet has been recently developing. Many of retailers and small companies rely on printed documents in stock dealing. In such cases, a purchase order is printed by a buyer. The printed purchase order is then read by a buyer""s facsimile and transmitted to a seller. Then, a seller""s facsimile receives the purchase order with a two-dimensional code representing the contents of the purchase order. The operator of the seller uses a scanner to read the encoded data from the two-dimensional code printed on the received purchase order. The readout data is registered in a managing computer or the like. Thus, the order receiving processing is simple.
In this manner, the two-dimensional code print data producing apparatus of the present invention is effectively used when all of the transaction cannot be systemized by the electronic processing. It is preferable that the print data includes at least one positioning symbol located at a corner of the two-dimensional matrix, and the positioning symbol is used for identifying the position of the two-dimensional code. This two-dimensional code is generally referred to as a QR code. Needless to say, the present invention is applicable to other two-dimensional codes, such as a data code, a CP code, a veri code, and a calra code.
The two-dimensional code print data producing apparatus of the present invention can be realized by a computer system. In this case, the computer system comprises a program for producing the print data of a two-dimensional code in accordance with the present invention. The program itself can be recorded in an appropriate recording medium, such as a floppy disk, a magnetooptic disk, or a CD-ROM. The recorded program is arbitrarily loadable from the recoding medium to the computer system. For example, the sellers handling the mail-order selling system usually send a merchandise catalog by mail to prospective buyers beforehand so that the buyers can select their favorite goods from the catalog. However, considering the wide spread use of personal computers and price down of recording media, it is possible to send a CD-ROM storing merchandise information instead of sending the catalog book. In such cases, it is preferable that the CD-ROM stores the program for producing the print data in accordance with the present invention together with the merchandise information. It is also possible to store the program in a ROM or a backup RAM (including a non-volatile RAM) which is installed in the computer system.
Another aspect of the present invention provides a method for producing print data of a two-dimensional code comprising dark and bright cells representing binary coded data and arranged as a pattern on a two-dimensional matrix. The method comprises the steps of developing a matrix pattern of dark and bright cells of regular size on a bit map, and modifying the cell size of specific cells on the bit map so that a boundary between the dark cells and the bright cells is adjustable before performing a printing operation.
Preferably, the two-dimensional print data producing method further comprises a step of outputting a dot arrangement image to a printer. The printer prints only dark cells while leaving a non-printed region which is discriminable as the bright cells.
Furthermore, another aspect of the present invention provides a recording medium storing a program for producing print data of a two-dimensional code comprising dark and bright cells representing binary coded data and arranged as a pattern on a two-dimensional matrix, characterized in that the program is recorded in a format readable by a computer, and the print data is for modifying the size of the dark cells in advance so that a boundary between the dark cells and the bright cells is adjustable before performing a printing operation.